<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/html/js/axios.min.js"></script>
    <script src="/html/js/util.js"></script>
</head>
<script>
    async function add() {
        let param = {
            name: $("userName").value,
            face: $("face").files[0]
        };

        let info = await uploadajaxPost("/cuser/add", param)
        alert(info);
    }


</script>

<body>
<!--<form action="/cuser/add" method="post" enctype="multipart/form-data">-->
<!--    姓名：<input type="text" name="userName"><br>-->
<!--    <img src="" alt="" id="faceImg" height="50" width="50">-->
<!--    头像：<input type="file" name="face" id="face" onchange="fileChange('face','faceImg')"><br>-->
<!--    <input type="submit" value="添加">-->
<!--</form>-->

姓名：<input type="text" id="userName"><br>
<img src="" alt="" id="faceImg" height="50" width="50">
头像：<input type="file" name="face" id="face" onchange="fileChange('face','faceImg')"><br>
<input type="button" onclick="add()" value="添加">

</body>
</html>